<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <script>
      var promise = new Promise(function (resolve, reject) {
        resolve();
      });
      promise
        .then(function(){
          throw new Error('error!!!'); //对比下边一行
          //catch:  Error: error!!!
          // return new Error('error!!!');
          // //then:  Error: error!!! 
          // return new Promise(function(resolve, reject){reject(1)});
          // // catch:  1
        })
        .then((res) => {
          console.log('then: ', res);
        })
        .catch((err) => {
          console.log('catch: ', err);
        });

          
    </script>
  </body>
</html>
